
#define BUFFER_SIZE	8192
void http_test(HttpSocketTask* pSocketTask)
{
	char* request = "GET / HTTP/1.1\r\n"
					"Host: news.sina.com.cn\r\n"
					"User-Agent: Mozilla/5.0 (compatible; MSIE 6.00; Windows XP)\r\n"
					"Accept: */*\r\n"
					"Connection: keep-alive\r\n\r\n";

	HttpSocket* pSocket = pSocketTask->socket;
	CXSOCKET cxSocket = pSocket->cxSocket;

	int nSend = cx_socket_write(cxSocket, request, strlen(request));
	if(nSend > 0)
	{
		char buf[BUFFER_SIZE] = {0};
		do 
		{

			if(cx_socket_isReady(cxSocket, CRF_READ) == CRF_READ)
			{
				cx_socket_read(cxSocket, buf, BUFFER_SIZE);
			}

		} while (1);

	}
	else
	{
		int n = WSAGetLastError();
		if(n != WSAEWOULDBLOCK)
		{
			exit(1);
		}

	}
}